<% title_tag [params[:q], t('common.search_result')].join(' · ') %>
<div class="search-results card card-lg">
  <div class="card-body">
    <div class="flex justify-between card-title">
      <div>Search result of: <b><%=params[:q] %></b></div>
      <div class="counter">Total <%= @result.count %> records</div>
    </div>
    <% if @result.count == 0 %>
      <div class="no-result">Can not find anything about: <%= params[:q]%></div>
    <% else %>
      <% @result.each do |doc| %>
        <% partial_view_name = doc.searchable_type.downcase -%>
        <% if doc.searchable %>
          <%= render partial: (partial_view_name == 'team' ? 'user' : partial_view_name), locals: { item: doc.searchable, hit: doc } %>
        <% end %>
      <% end %>
    <% end %>
    <%= paginate @result %>
  </div>
</div>
